package com.sugar.subscribe.course.module.business.util;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class AmountUtil {

    public static BigDecimal centToYuan(Integer cent){
        return BigDecimal.valueOf(cent).divide(BigDecimal.valueOf(100), 2, RoundingMode.DOWN);
    }

    public static Integer yuanToCent(BigDecimal yuan){
        return yuan.multiply(BigDecimal.valueOf(100)).intValue();
    }
}
